home *** CD-ROM | disk | FTP | other *** search
- Path: rahul.net!a2i!news
- From: terris@rahul.net (Terris Linenbach)
- Newsgroups: comp.lang.c++
- Subject: Re: STL with MSVC++ 4.0
- Date: 13 Feb 1996 05:41:07 GMT
- Organization: a2i network
- Message-ID: <4fp89k$6f8@hustle.rahul.net>
- References: <4flp0o$101@lal.interserv.net> <311F7759.530F@best.com>
- NNTP-Posting-Host: 534.rahul.net
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-Newsreader: WinVN 0.99.6
-
- Put
-
- using namespace std;
-
- at the beginning of your method.
-
- - Terris
-
- In article <311F7759.530F@best.com>, bobo@best.com says...
- >
- >dvisage@interserv.com wrote:
- >>
- >> >>include new.h. Beyond that, I'm still tracking down ambiguos operators
- >> >>for the iterator types. You can make it work, but its not a gimme.
- >> >
- >> >>John S.
- >> >
- >> >Microsoft have a paper on MFC and Standard Template Library at
- >> >http://www.microsoft.com/visualc/v4/v4tech/stlchg.htm
- >> >
- >> >
- >> >Cheers,
- >> >Peter J Brock
- >> >http:/www.magna.com.au/~peter
- >> >
- >> I have also had similar problems with ambigous iterator operators.
- Especially,
- >> the map::iterator. To get around the namespace problem, you also need to
- >> include iostream.h as well as new.h in order for the piece of **** to even
- >> compile with MFC source code.
- >>
- >> I just recently download a copy of STL dated October 1995 that no longer
- >> seem to want to compile my source code. The previous version that I
- >> was using seemed to work.
- >>
- >> The problem is an ambiguos map::const_iterator::operator!=()
- >
- >This is an annoying problem to be sure. I know of two ways around it:
- >
- >a) put the code in which the ambiguity arises in the std namespace as well.
- This is
- >not as big a pain as it sounds. It makes sense from a design point of view
- to
- >encapsulate code that uses STL with other portable code, separate from MFC.
- >
- >b) Use this notation:
- >
- >if (std::operator!=(anIter,aMap.end())) {
- >...
- >}
- >
- >or somesuch. You might need to qualify it a bit more, but I've been able to
- get this
- >approach to work. It is definitely not as preferable as solution a) because
- if you
- >change the map, say, to a vector, this code will have to be replaced by:
- >
- >if (anIter != aMap.end()) {...}
- >
- >cheers,
- >Eric Bowman
- >bobo@best.com
- >Maxis Core Technology Group, San Mateo, California, USA
-
-